const Router = require('koa-router');

const apps = require('./apps');
const apkInfo = require('./apkInfo');
const tvInfo = require('./tvInfo');
const categories = require('./categories');
const getType = require('./getType');
const recommennd = require('./recommend');
const lanucher = require('./launcher-app');

const router = new Router();

[
    apps,
    apkInfo,
    tvInfo,
    categories,
    getType,
    recommennd,
    lanucher,
].forEach(el => el.call(router));

router.all('/*', async ctx => {
    console.log('404', ctx.request.href);
    ctx.body = ctx.originalUrl;
})

module.exports = router;